home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
ASSEMBLER
/
EXTASM
/
Examples
/
STACK
< prev
next >
Wrap
Text File
|
1993-10-11
|
844b
|
17 lines
#set StackSize = 1024 ; how large stack do we want?
.Start
b Main ; jump over the stack
.Stack_Ceiling ; top-of-stack
dbb StackSize,0 ; allocate stack space here
.Stack_Floor ; bottom-of-stack
.Old_Stack dcd 0 ; place to store old r13
.Main
str r13,Old_Stack ; save old r13
adr r13,Stack_Floor ; r13-> new stack
stmfd r13!,{r0-r12,r14} ; push all registers on our stack
.Begin
; normal code ; put your program here
.End
ldmfd r13!,{r0-r12,r14} ; pop all registers from our stack
ldr r13,Old_Stack ; get old r13
movs pc,r14 ; return with all registers intact